package com.xiaoshuidi.cloud.module.rooms.mq.listener;

import com.xiaoshuidi.cloud.module.rooms.controller.admin.roomequipment.vo.RoomEquipmentRespVO;
import com.xiaoshuidi.cloud.module.rooms.controller.admin.roomequipmentsupplier.vo.EquipmentSupplierImportVO;
import com.xiaoshuidi.cloud.module.rooms.controller.admin.roomequipmentsupplier.vo.ImportResp;
import com.xiaoshuidi.cloud.module.rooms.service.IRoomEquipmentSupplierService;
import lombok.extern.slf4j.Slf4j;

/**
 * 监听器
 *
 * @Author: lss
 * @CreateTime: 2023-05-06 10:10
 * @Version: 1.0
 */
@Slf4j
public class RoomEquipmentSupplierListener extends AbstractExcelListener<EquipmentSupplierImportVO> {

    private IRoomEquipmentSupplierService service;

    public RoomEquipmentSupplierListener(IRoomEquipmentSupplierService service) {
        this.service = service;
    }

    /**
     * 加上存储数据库
     */
    @Override
    public void saveData() {
        log.info("{}条数据，开始存储数据库！", cachedDataList.size());

        ImportResp importResp = service.importRoomEquipmentSupplier(cachedDataList);
//        log.info("存储数据库结果：" + importResp);
    }
}
